<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="app">
    <button v-on:click="msg='你好世界'">按钮</button>
    <button v-on:click="fn">绑定方法1</button>
    <button @click="fn2('我传的参数')">绑定方法2</button>
    {{ msg }}
  </div>
  <script src="./vue.js"></script>
  <script>

    const vm = new Vue({
      el: '#app',
      data: {
       msg: '你好vue'
      },
      methods: {
        fn(){
          this.msg = '通过方法改变数据'
        },
        fn2(msg){
          this.msg = msg;
        }
      }
    })
    
  </script>
</body>

</html>